#ifndef __AUDIO_WAV__
#define __AUDIO_WAV__

//------------------------------------------------------------------------------
/// Standard WAV file header information.
//------------------------------------------------------------------------------
typedef struct _WavHeader
{
	/// Contains the letters "RIFF" in ASCII form.
	unsigned int  chunkID;
	/// Size of the rest of the chunk following this number.
	unsigned int  chunkSize;
	/// Contains the letters "WAVE".
	unsigned int format;
	/// Contains the letters "fmt ".
	unsigned int subchunk1ID;
	/// 16 for PCM.  This is the size of the rest of the Subchunk
	/// which follows this number.
	unsigned int  subchunk1Size;
	/// PCM = 1 (i.e. Linear quantization). Values other than 1 indicate some
	/// form of compression.
	unsigned short audioFormat;
	/// Mono = 1, Stereo = 2, etc.
	unsigned short numChannels;
	/// 8000, 44100, etc.
	unsigned int   sampleRate;
	/// SampleRate * NumChannels * BitsPerSample/8
	unsigned int   byteRate;
	/// NumChannels * BitsPerSample/8
	unsigned short blockAlign;
	/// 8 bits = 8, 16 bits = 16, etc.
	unsigned short bitsPerSample;
	/// Contains the letters "data".
	unsigned int subchunk2ID;
	/// Number of bytes in the data.
	unsigned int subchunk2Size;

} WavHeader;

/// WAV letters "RIFF"
#define WAV_CHUNKID			0x46464952
/// WAV letters "WAVE"
#define WAV_FORMAT			0x45564157
/// WAV letters "fmt "
#define WAV_SUBCHUNKID		0x20746D66



int Wav_Play(char *fname);

void process_wav_buffer(void);


#endif

